export const isLastPage = (lastPage) => {
  if (!lastPage?.result) return true
  return lastPage.result.current_page >= lastPage.result.total
}

//url路径解密函数
export const decryptUrl = (encryptedUrl) => {
  var decryptionKey = 'aqjl10scommunitySYKey' // 与后端相同的解密密钥
  // 自定义解密逻辑
  // 这里使用与加密相反的操作，将密文的每个字符减去密钥的字符来还原明文
  var decryptedUrl = ''
  for (var i = 0; i < encryptedUrl.length; i++) {
    var encryptedChar = encryptedUrl.charAt(i)
    var decryptedChar = String.fromCharCode(
      encryptedChar.charCodeAt(0) - decryptionKey.charCodeAt(i % decryptionKey.length),
    )
    decryptedUrl += decryptedChar
  }
  return decryptedUrl
}
